<template>
  <div class="mouldForm" id="tableInfoBox">
    <el-form
      :model="formData"
      class="demo-ruleForm"
      ref="ruleForm"
      label-position="left"
    >
      <el-col
        v-for="(formobj, index) in formObj"
        v-show="!formobj.notShow"
        :key="index"
        :span="formobj.width ? formobj.width : 24"
        
      >
        <el-form-item
          v-if="formobj.label"
          :label="formobj.label"
          :prop="formobj.prop"
          :rules="formobj.rules"
         
        >
          <el-input
            :class="'bgwarn' + formData[formobj.bgwarn]"
            v-if="formobj.input"
            v-model="formData[formobj.prop]"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            @input="inputINPUT($event, index, formobj.prop)"
            @change="inputChange($event, index, formobj.prop)"
            @focus="inputFocus(index, formobj.prop)"
            @blur="inputBlur($event, index, formobj.prop)"
          />
          <div v-if="formobj.manyinput" style="display: flex">
            <el-input
              v-if="formobj.manyinput"
              v-model="formData[formobj.prop][0]"
              size="small"
              type="text"
              autosize
              :disabled="formobj.disabled"
              :placeholder="formobj.placeholder"
            />
            <div style="width: 50px; text-align: center">~</div>
            <el-input
              v-if="formobj.manyinput"
              v-model="formData[formobj.prop][1]"
              size="small"
              type="text"
              autosize
              :disabled="formobj.disabled"
              :placeholder="formobj.placeholder"
            />
          </div>
          <div v-if="formobj.inputBtn" style="display: flex; width: 98.2%">
            <!-- <el-input
                v-if="formobj.inputBtn"
                v-model="formData[formobj.prop]"
                autocomplete="off"
              >
              </el-input> -->
            <el-input
              :class="'bgwarn' + formData[formobj.bgwarn]"
              v-if="formobj.inputBtn"
              v-model="formData[formobj.prop]"
              size="small"
              :disabled="formobj.disabled"
              :placeholder="formobj.placeholder"
              @input="inputINPUT($event, index, formobj.prop)"
              @change="inputChange($event, index, formobj.prop)"
              @focus="inputFocus(index, formobj.prop)"
              @blur="inputBlur($event, index, formobj.prop)"
            />

            <el-button
              type="primary"
              v-if="formobj.inputButton"
              icon="el-icon-search"
              size="small"
              @click="clickDialog(index, formobj.prop)"
              style="margin: 8px 0 2px 3px"
              >选择</el-button
            >
          </div>

          <el-input
            :class="'bgwarn' + formData[formobj.bgwarn]"
            v-if="formobj.inputNumber"
            v-model="formData[formobj.prop]"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            type="number"
            @input="inputINPUT($event, index, formobj.prop)"
            @change="inputChange($event, index, formobj.prop)"
          />
          <!-- textarea输入框 :rows="formObj.rows"-->
          <div v-if="formobj.textarea" class="yjxatextarea">
            <el-input
              v-if="formobj.textarea"
              v-model="formData[formobj.prop]"
              size="small"
              type="textarea"
              autosize
              :row="formobj.row || 3"
              :disabled="formobj.disabled"
              :placeholder="formobj.placeholder"
            />
          </div>

          <!-- select选择器 -->
          <el-select
            v-if="formobj.selectInput"
            v-model="formData[formobj.prop]"
            size="small"
            filterable
              clearable
              allow-create

            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            @change="selectChange($event, index, formobj.prop)"
          >
         
            <el-option
              v-for="(options, sIndex) in formobj.options"
              :key="sIndex"
              :label="options.label"
              :value="options"
            />
          </el-select>
          <el-select
            v-if="formobj.select"
          
            v-model="formData[formobj.prop]"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            @change="selectChange($event, index, formobj.prop)"
          >
            <el-option
              v-for="(options, sIndex) in formobj.options"
              :key="sIndex"
              :label="options.label"
              :value="options"
            />
          </el-select>
          
          <el-select
          v-if="formobj.selectFilterable"
            filterable
            v-model="formData[formobj.prop]"
            size="small"
            allow-create
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            @change="selectChange($event, index, formobj.prop)"
          >
            <el-option
              v-for="(options, sIndex) in formobj.options"
              :key="sIndex"
              :label="options.label"
              :value="options"
            />
          </el-select>


          
          <!-- 多选 -->

          <el-select
            v-if="formobj.selectMultiple"
            v-model="formData[formobj.prop]"
            :disabled="formobj.disabled"
            multiple
            :placeholder="formobj.placeholder"
            @change="selectChange1($event, index, formobj.prop)"
          >
            <el-option
              v-for="(options, sIndex) in formobj.options"
              :key="sIndex"
              @visible-change="$forceUpdate()"
              :label="options.label"
              :value="options"
            >
            </el-option>
          </el-select>
          <el-select
            v-if="formobj.selectMultiple1"
            v-model="formData[formobj.prop]"
            :disabled="formobj.disabled"
            multiple
            :placeholder="formobj.placeholder"
            @change="selectChange1($event, index, formobj.prop)"
          >
            <el-option
              v-for="(options, sIndex) in formobj.options"
              :key="sIndex"
              @visible-change="$forceUpdate()"
              :label="options.label"
              :value="options"
              :title="options.value"
            >
            </el-option>
          </el-select>
          <el-select
            @change="function (v) {
                return selectProject(v, index, formobj.prop);
              }
            "
            v-if="formobj.xm"
            v-model="formData[formobj.prop]"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
          >
            <el-option
              v-for="(options, sIndex) in projectsObj"
              :key="sIndex"
              :label="options.fItemName"
              :value="options"
            >
            </el-option>
          </el-select>
          <!-- <el-select v-if="formobj.bd" v-model="formData[formobj.prop]" size="small" :disabled="formobj.disabled"
            :placeholder="formobj.placeholder">
            <el-option v-for="(options, sIndex) in tendersObj" :key="sIndex" :label="options.fItemName"
              :value="options.fItemValue" />
          </el-select> -->

          <el-select
            @change="function (v) {return selectCompany(v, index, formobj.prop);
              }
            "
            v-if="formobj.bd"
            v-model="formData[formobj.prop]"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
          >
            <el-option
              v-for="(options, sIndex) in tendersObj"
              :key="sIndex"
              :label="options.fItemName"
              :value="options"
            >
            </el-option>
          </el-select>
          <el-select
            v-if="formobj.selects"
            v-model="formData[formobj.prop]"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            @change="selectChange($event, index, formobj.prop)"
          >
            <el-option
              v-for="(options, sIndex) in formobj.options"
              :key="sIndex"
              :label="options.label"
              :value="options.label"
            />
          </el-select>
          <!-- 多选 -->
          <el-select
            v-if="formobj.manySelect"
            v-model="formData[formobj.prop]"
            size="small"
            multiple
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            @change="selectChange($event, index, formobj.prop)"
          >
            <el-option
              v-for="(options, sIndex) in formobj.options"
              :key="sIndex"
              :label="options.label"
              :value="options"
            />
          </el-select>
          <!-- select搜索框 -->
          <el-select
            v-if="formobj.searchSelect"
            v-model="formData[formobj.prop]"
            size="small"
            :disabled="formobj.disabled"
            filterable
            remote
            reserve-keyword
            :placeholder="formobj.placeholder"
            :remote-method="(query) => remoteMethod(query, index, formobj.prop)"
            :loading="searchSelectLoading"
            @change="selectChange($event, index, formobj.prop)"
          >
            <el-option
              v-for="(item, ssIndex) in formobj.options"
              :key="ssIndex"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
          <el-date-picker
            type="year"
            @change="selectChange($event, index, formobj.prop)"
            v-if="formobj.year"
            v-model="formData[formobj.prop]"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
          >
          </el-date-picker>
          <!-- 年月日时分秒选择器 -->
          <el-date-picker
            v-if="formobj.dateTime"
            v-model="formData[formobj.prop]"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
          />
          <!-- 月 -->
          <el-date-picker
            v-if="formobj.month"
            value-format="MM"
            v-model="formData[formobj.prop]"
            type="month"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
          >
          </el-date-picker>
          <!-- 年月日时分秒，开始和结束时间 -->
          <el-date-picker
            v-if="formobj.dateTimeRange"
            v-model="formData[formobj.prop]"
            value-format="yyyy-MM-dd HH:mm:ss"
            format="yyyy-MM-dd HH:mm:ss"
            size="small"
            type="datetimerange"
            :disabled="formobj.disabled"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          />
          <!-- 时分秒选择器 -->
          <el-time-picker
            v-if="formobj.timePicker"
            v-model="formData[formobj.prop]"
            value-format="HH:mm:ss"
            format="HH:mm:ss"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            :picker-options="formobj.options"
          />
          <!-- 时分秒选择器，开始和结束时间 -->
          <el-time-picker
            v-if="formobj.timePickerIsRange"
            v-model="formData[formobj.prop]"
            value-format="HH:mm:ss"
            format="HH:mm:ss"
            is-range
            size="small"
            :disabled="formobj.disabled"
            range-separator="至"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            placeholder="选择时间范围"
          />
          <!-- 年月日选择器 -->
          <el-date-picker
            v-if="formobj.datePicker"
            v-model="formData[formobj.prop]"
           @change="selectChange($event, index, formobj.prop)"
            value-format="yyyy-MM-dd"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
          />

          <el-date-picker
            :picker-options="pickerOption"
            @change="selectChange($event, index, formobj.prop)"
            v-if="formobj.datePicker1"
            v-model="formData[formobj.prop]"
            value-format="yyyy-MM-dd"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
          />
          <el-date-picker
            :picker-options="pickerOptions"
            @change="selectChange($event, index, formobj.prop)"
            v-if="formobj.datePicker2"
            v-model="formData[formobj.prop]"
            value-format="yyyy-MM-dd"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
          />
          <!-- 年月日选择器，开始和介绍年月日 -->
          <el-date-picker
            v-if="formobj.datePickerIsRange"
            v-model="formData[formobj.prop]"
            value-format="yyyy-MM-dd"
            type="daterange"
            size="small"
            :disabled="formobj.disabled"
            :placeholder="formobj.placeholder"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          />
          <!-- switch开关 -->
          <el-switch
            v-if="formobj.switch"
            v-model="formData[formobj.prop]"
            size="small"
            :disabled="formobj.disabled"
            @change="formSwitchChange($event, index, formobj.prop)"
          />
          <!-- radio单选框 -->
          <el-radio-group
            @input="changeRadio"
            v-if="formobj.radio"
            v-model="formData[formobj.prop]"
            :disabled="formobj.disabled"
          >
            <!-- <el-radio v-for="(options, rIndex) in formobj.options" :key="rIndex" :label="options.label"
                              :value="options.value" /> -->
            <el-radio
              v-for="(options, rIndex) in formobj.options"
              :key="rIndex"
              :label="options.value"
              >{{ options.label }}</el-radio
            >
          </el-radio-group>
          <!-- checkbox复选框 -->
          <el-checkbox-group
            v-if="formobj.checkbox"
            v-model="formData[formobj.prop]"
            :disabled="formobj.disabled"
          >
            <el-checkbox
              v-for="options in formobj.options"
              :key="options.value"
              :label="options.label"
            />
          </el-checkbox-group>
          <!-- 文件上传 -->
          <!-- 如果对象有值就回显，没有值就为空 -->
          <!-- 按钮 -->
          <el-button
            v-if="formobj.button"
            size="small"
            :disabled="formobj.disabled"
            :loading="formobj.loading"
            :type="formobj.buttonType || 'primary'"
            @click="buttonClick(formobj.prop, index)"
          >
            {{ formobj.placeholder }}
          </el-button>
          <!-- text展示 -->

          <span v-if="formobj.text" v-text="formData[formobj.prop]" />
          <!-- 计量单位 -->
          <span v-if="formobj.unit" class="left10">{{ formobj.unit }}</span>
          <div v-if="formobj.upload" style="display: flex; width: 98.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
              :style="{ border: uploadStyles }"
            >
              <div
                v-for="(v, i) in fileLists"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs(v)"
                  v-if="fileType == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                  v-viewer
                  @click="openPdfs(v)"
                  v-if="fileType == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload"
              @closes="closeDialog"
              :fileType="fileType"
              :folderid="timestamp"
              @upFileList="getFile"
              :fileArray="fileLists"
              @delteFile="delteFile"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles"
              @closes="dialogVisibles = false"
              :fileDetail="fileDetail"
            >
            </pdfDialog>
          </div>

          <div v-if="formobj.uploada" style="display: flex; width: 98.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
            >
              <div
                v-for="(v, i) in fileListsa"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs1(v)"
                  v-if="fileType1 == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                @click="openPdfs1(v)"
                  v-viewer
                  v-if="fileType1 == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload1"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload1"
              @closes="closeDialog1"
              :fileType="fileType1"
              :folderid="timestampa"
              @upFileList="getFile1"
              :fileArray="fileListsa"
              @delteFile="delteFile1"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles1"
              @closes="dialogVisibles1 = false"
              :fileDetail="fileDetail1"
            >
            </pdfDialog>
          </div>
          <div v-if="formobj.uploadb" style="display: flex; width: 98.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
            >
              <div
                v-for="(v, i) in fileListsb"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs2(v)"
                  v-if="fileType2 == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                @click="openPdfs2(v)"
                  v-viewer
                  v-if="fileType2 == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload2"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload2"
              @closes="closeDialog2"
              :fileType="fileType2"
              :folderid="timestampb"
              @upFileList="getFile2"
              :fileArray="fileListsb"
              @delteFile="delteFile2"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles2"
              @closes="dialogVisibles2 = false"
              :fileDetail="fileDetail2"
            >
            </pdfDialog>
          </div>

          <div v-if="formobj.uploadc" style="display: flex; width: 98.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
            >
              <div
                v-for="(v, i) in fileListsc"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs3(v)"
                  v-if="fileType3 == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                @click="openPdfs3(v)"
                  v-viewer
                  v-if="fileType3 == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload3"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload3"
              @closes="closeDialog3"
              :fileType="fileType3"
              :folderid="timestampc"
              @upFileList="getFile3"
              :fileArray="fileListsc"
              @delteFile="delteFile3"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles3"
              @closes="dialogVisibles3 = false"
              :fileDetail="fileDetail3"
            >
            </pdfDialog>
          </div>

          <div v-if="formobj.uploadd" style="display: flex; width: 98.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
            >
              <div
                v-for="(v, i) in fileListsd"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs4(v)"
                  v-if="fileType4 == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                @click="openPdfs4(v)"
                  v-viewer
                  v-if="fileType4 == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload4"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload4"
              @closes="closeDialog4"
              :fileType="fileType4"
              :folderid="timestampd"
              @upFileList="getFile4"
              :fileArray="fileListsd"
              @delteFile="delteFile4"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles4"
              @closes="dialogVisibles4 = false"
              :fileDetail="fileDetail4"
            >
            </pdfDialog>
          </div>
          <div v-if="formobj.uploade" style="display: flex; width: 98.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
            >
              <div
                v-for="(v, i) in fileListse"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs5(v)"
                  v-if="fileType5 == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                @click="openPdfs5(v)"
                  v-viewer
                  v-if="fileType5 == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload5"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload5"
              @closes="closeDialog5"
              :fileType="fileType5"
              :folderid="timestampe"
              @upFileList="getFile5"
              :fileArray="fileListse"
              @delteFile="delteFile5"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles5"
              @closes="dialogVisibles5 = false"
              :fileDetail="fileDetail5"
            >
            </pdfDialog>
          </div>
          <div v-if="formobj.uploadf" style="display: flex; width: 98.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
            >
              <div
                v-for="(v, i) in fileListsf"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs6(v)"
                  v-if="fileType6 == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                @click="openPdfs6(v)"
                  v-viewer
                  v-if="fileType6 == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload6"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload6"
              @closes="closeDialog6"
              :fileType="fileType6"
              :folderid="timestampf"
              @upFileList="getFile6"
              :fileArray="fileListsf"
              @delteFile="delteFile6"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles6"
              @closes="dialogVisibles6 = false"
              :fileDetail="fileDetail6"
            >
            </pdfDialog>
          </div>
          <div v-if="formobj.uploadeg" style="display: flex; width: 98.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
            >
              <div
                v-for="(v, i) in fileListsg"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs7(v)"
                  v-if="fileType7 == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                @click="openPdfs7(v)"
                  v-viewer
                  v-if="fileType5 == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload7"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload7"
              @closes="closeDialog7"
              :fileType="fileType7"
              :folderid="timestampg"
              @upFileList="getFile7"
              :fileArray="fileListsg"
              @delteFile="delteFile7"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles7"
              @closes="dialogVisibles7 = false"
              :fileDetail="fileDetail7"
            >
            </pdfDialog>
          </div>
          <!-- 适用于工作指令执行报告   左边内容过长使用 -->
          <div v-if="formobj.upload1" style="display: flex; width: 80.2%">
            <el-input v-if="false" autocomplete="off"> </el-input>
            <div
              style="
                height: 40px;
                line-height: 40px;
                width: 100%;
                display: flex;
                border: 1px solid #e4e7ed;
                border-radius: 5px;
              "
            >
              <div
                v-for="(v, i) in fileLists"
                :key="i"
                style="margin: 2px 3px; height: 87%"
              >
                <div
                  @click="openPdfs(v)"
                  v-if="fileType == 1"
                  style="width: 100%; height: 100%"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="pdfUrl"
                  />
                </div>
                <div
                  v-viewer
                  @click="openPdfs(v)"
                  v-if="fileType == 0"
                  style="width: 100%; height: 100%"
                >
                  <img style="max-width: 100%; max-height: 100%" :src="v.url" />
                </div>
              </div>
            </div>
            <el-button
              type="primary"
              v-if="formobj.uploadSelect"
              icon="el-icon-search"
              size="small"
              @click="clickUpload"
              style="margin: 8px 0 2px 3px"
              >操作</el-button
            >
            <uploads
              :dialogUpload="dialogUpload"
              @closes="closeDialog"
              :fileType="fileType"
              :folderid="timestamp"
              @upFileList="getFile"
              :fileArray="fileLists"
              @delteFile="delteFile"
            >
            </uploads>
            <pdfDialog
              :dialogVisible="dialogVisibles"
              @closes="dialogVisibles = false"
              :fileDetail="fileDetail"
            >
            </pdfDialog>
          </div>
          <!-- 适用于工作指令执行报告   左边内容过长使用 -->
        </el-form-item>
        <div v-if="formobj.labels">
          <img
            style="vertical-align: middle"
            src="@/assets/img/Supervision/com_flg.png"
            alt=""
          />
          <span style="margin-left: 8px">{{ formobj.labels }}</span>
        </div>
      </el-col>
    </el-form>
    <messageBox
      :showMsgBox="showMsgBox"
      :msgTip="msgTip"
      :msgType="msgType"
      @confirmMsg="confirmMsg"

    ></messageBox>
  </div>
</template>
ng封装,date:20210429,详细使用见根目录@/views/home/testForm/testForm.vue,————————————————————————————————————————————————————————————————————————————————
-->
<script>
import uploads from "@/components/public/el-upload.vue";
import pdfDialog from "@/components/public/pdf-dialog";
import { upload } from "@/api/request.js";
import actions from "@/actions";
import messageBox from "@/components/public/messageBox"; //主页面分页

// import mySelect from "@/components/BehaViorManage/workYear/select";
// import aMap from '../../map/aMap.vue'
// import quillEditor from '@/components/quillEditor/quillEditor.vue'
export default {
  components: {
    // quillEditor
    uploads,
    pdfDialog,
    messageBox
    // mySelect
  },
  props: {
    formObj: {
      type: Array,
      required: true,
    },

    startDates: {
      type: Number,
    },
    lableWidth: {
      type: String,
      default: "120px",
    },

    selected: {
      type: Array,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      required: true,
    },
    fileType: {
      type: String,
      default: "1",
    },
    fileType1: {
      type: String,
      default: "1",
    },fileType2: {
      type: String,
      default: "1",
    },fileType3: {
      type: String,
      default: "1",
    },fileType4: {
      type: String,
      default: "1",
    },
    fileType5: {
      type: String,
      default: "1",
    },
    fileType6: {
      type: String,
      default: "1",
    },
    fileType7: {
      type: String,
      default: "1",
    },
    searchSelectOptionsCb: {
      type: Array,
    },
    timestamp: {
      type: String,
    },
    timestampa: {
      type: String,
    },
    timestampb: {
      type: String,
    },
    timestampc: {
      type: String,
    },
    timestampd: {
      type: String,
    },
    timestampe: {
      type: String,
    },
    timestampf: {
      type: String,
    },
    timestampg: {
      type: String,
    },
    fileList: {
      type: Array,
      default: () => {
        return [];
      },
    },
    fileList1: {
      type: Array,
      default: () => {
        return [];
      },
    },
    fileList2: {
      type: Array,
      default: () => {
        return [];
      },
    },
    fileList3: {
      type: Array,
      default: () => {
        return [];
      },
    },
    fileList4: {
      type: Array,
      default: () => {
        return [];
      },
    },
    fileList5: {
      type: Array,
      default: () => {
        return [];
      },
    },   fileList6: {
      type: Array,
      default: () => {
        return [];
      },
    },
    fileList7: {
      type: Array,
      default: () => {
        return [];
      },
    },
    messAgeNum: {
      type: Number,
      default: 0,
    },
    uploadStyle: {
      type: Number,
      default: 0,
    },
    submitStatus: {
      type: String,
      default: 0,
    },
  },
 
  data() {
   
    return {
      activeName: "1",
      status:null,
      uploadStyles: "1px solid #d1d7e2",
      showMsgBox: false,
            msgTip: "请先选中数据行！",
            msgType: 1,
      // uploadUrl: uploadFileUrl,
      dialogImageUrl: "",
      searchSelectLoading: false,
      dialogVisible: false,
      dialogVisible1: false,
      dialogVisible2: false,
      dialogVisible3: false,
      dialogVisible4: false,
      dialogVisible5: false,
      dialogVisible6: false,

      dialogVisible7: false,



      disabled: false,
      searchShow: "", //高德地图input收索联想
      setSearchVal: [], //高德地图赋值搜索内容
      userInfo: {},
      enclosureImg: {},
      fSourcefileList: [],

      dialogUpload: false,
      dialogUpload1: false,
      dialogUpload2: false,
      dialogUpload3: false,
      dialogUpload4: false,
      dialogUpload5: false,
      dialogUpload6: false,
      dialogUpload7: false,



      dialog: false, //弹出框
      fileLists: [],
      fileListsa: [],
      fileListsb: [],
      fileListsc: [],
      fileListsd: [],
      fileListse: [],
      fileListsf: [],
      fileListsg: [],




      dialogVisibles: false,
      dialogVisibles1: false,
      dialogVisibles2: false,
      dialogVisibles3: false,
      dialogVisibles4: false,
      dialogVisibles5: false,
      dialogVisibles6: false,
      dialogVisibles7: false,



      fileDetail: null,
      fileDetail1: null,
      fileDetail2: null,
      fileDetail3: null,
      fileDetail4: null,
      fileDetail5: null,
      fileDetail6: null,
      fileDetail7: null,




      projectsObj: [],
      tendersObj: [],
      formDatas: {},

      pickerOptions: null,
      pdfUrl: require("@/assets/img/pdf.png"),
      pickerOption: {
        disabledDate(time) {
          return time.getTime() > Date.now();
          // return '2023/05/07' || time.getTime() > Date.now();
        },
      },
    };
  },
  update() {
    this.$forceUpdate(); //强制刷新视图
  },
  created() {
    this.userInfo = JSON.parse(sessionStorage.getItem("GxBack-userInfo"));
  },
  // computed: {
  //     'formData.fWarninglevel': {
  //         get: function () {
  //             return this.formData.fWarninglevel == 1 ? '男' : this.formData.fWarninglevel == 0 ? '女' : '未知'
  //         },
  //         set: function (value) {
  //             this.formData.fWarninglevel = value === '男' ? 1 : 0
  //         }
  //     }
  // },
  watch: {
    "formData.fWarninglevel": {
      handler(newVal) {
        if (newVal == 0) {
          this.formData.fWarninglevel = "正常";
        } else if (newVal == 1) {
          this.formData.fWarninglevel = "一级";
        } else if (newVal == 2) {
          this.formData.fWarninglevel = "二级";
        } else if (newVal == 3) {
          this.formData.fWarninglevel = "三级";
        } else if (newVal == 4) {
          this.formData.fWarninglevel = "四级";
        } else if (newVal == 5) {
          this.formData.fWarninglevel = "五级";
        }
      },
      immediate: true,
      deep: true, // 可以深度检测到 person 对象的属性值的变化
    },
    fileList: {
      handler(newVal) {
        if (newVal) {
          this.fileLists = this.fileList;
        }
      },
      immediate: true,
    },
    fileList1: {
      handler(newVal) {
        if (newVal) {
          this.fileListsa = this.fileList1;
        }
      },
      immediate: true,
    },
    fileList2: {
      handler(newVal) {
        if (newVal) {
          this.fileListsb = this.fileList2;
        }
      },
      immediate: true,
    },
   
    fileList3: {
      handler(newVal) {
        if (newVal) {
          this.fileListsc = this.fileList3;
        }
      },
      immediate: true,
    },
    fileList4: {
      handler(newVal) {
        if (newVal) {
          this.fileListsd = this.fileList4;
        }
      },
      immediate: true,
    },
    fileList5: {
      handler(newVal) {
        if (newVal) {
          this.fileListse = this.fileList5;
        }
      },
      immediate: true,
    },
    fileList7: {
      handler(newVal) {
        if (newVal) {
          this.fileListsg = this.fileList7;
        }
      },
      immediate: true,
    },
    fileList6: {
      handler(newVal) {
        if (newVal) {
          this.fileListsf = this.fileList6;
        }
      },
      immediate: true,
    },
    selected: {
      handler(newVal) {
        if (newVal) {
          if (JSON.stringify(newVal) != "{}") {
            this.getLstInteger(newVal);
          }
        }
      },
      immediate: true,
    },
    timestamp: {
      handler(newVal) {
        if (newVal) {
         console.log(9090909,newVal);
        }
      },
      immediate: true,
    },
    startDates: {
      handler(newVal) {
        if (newVal) {
          this.pickerOptions = {
            disabledDate(time) {
              return time.getTime() > Date.now() || time.getTime() < newVal;
            },
          };
        }
      },
      immediate: true,
    },
    submitStatus:{
      handler(newVal) {
        if (newVal) {
          console.log(9999,newVal);
          this.status = newVal;
        }
      },
      immediate: true,
    },
    formData: {
      handler(newVal) {
        if (newVal) {
          this.formDatas = newVal;
        }
      },
      immediate: true,
    },
  },
  mounted() {
    actions.onGlobalStateChange((state, prev) => {
      this.userInfo = prev.currentUser;
      var data = prev.currentUser.projects;
      this.projectsObj = [
        {
          fItemName: "所有项目",
          fItemValue: "",
        },
      ];
      data.map((item) => {
        this.projectsObj.push({
          fItemName: item.projectName,
          fItemValue: item.projectId,
        });
      });
      this.formData[this.projectName] = this.projectsObj[1].fItemName;
      this.formData.fProjectid = this.projectsObj[1].fItemValue;

      this.getTender(this.projectsObj[1].fItemValue);
    }, true);
  },
  methods: {
    confirmMsg() {
            this.showMsgBox = false;
        },
    selectProject(e) {
      // this.formData.fProjectname = e.fItemName;
      // this.formData.fProjectid = e.fItemValue;
      // console.log(11, e.fItemValue);
      // this.formData[this.fProjectname] = e.fItemName

      this.getTender(e.fItemValue);
    },

    async getTender(e) {
      await this.$http(
        " http://172.18.5.31:8300/IOTManagement/Base/Company/getGXJLBaseCompanyList.do?projectId=" +
          e
      ).then((res) => {
        if (res.status == 200) {
          var data = res.data.data.GXCompanyList;
          this.tendersObj = [
            {
              fItemName: "所有标段",
              fItemValue: "",
            },
          ];
          data.map((item) => {
            this.tendersObj.push({
              fItemName: item.sectionName,
              fItemValue: item.sectionId,
            });
          });
        }
      });
    },
    selectCompany(e) {
      this.formData.fCompanyname = e.fItemName;
      this.formData.fCompanyid = e.fItemValue;
      // this.formData[this.fCompanyname] = e.fItemName

      //   this.falgId = e
    },
    getLstInteger(val) {
      //

      // var name;
      val.map((item) => {
        //  name= item.name
        this.formData[item.name] = item.selected;
      });
      // console.log(344333, val, this.formData);
      // this.formData.fVarietyname1=val
      //   this.formData = {
      //   ...val,
      //   type: JSON.parse(val.fVarietyname1),
      // };
    },

    collapseChange(val) {
      return val;
    },
    // 照片文件
    closeDialog() {
      this.dialogUpload = false;
      
    },
    closeDialog1() {
      this.dialogUpload1 = false;
    },closeDialog2() {
      this.dialogUpload2 = false;
    },closeDialog3() {
      this.dialogUpload3 = false;
    },closeDialog4() {
      this.dialogUpload4 = false;
    },
    closeDialog5() {
      this.dialogUpload5 = false;
    },

    closeDialog6() {
      this.dialogUpload6 = false;
    },
    closeDialog7() {
      this.dialogUpload7 = false;
    },
    getFile(val) {
      this.fileLists = val;
      this.uploadStyles = "1px solid #d1d7e2";

      return val;
    },
    getFile1(val) {
      this.fileListsa = val;

      return val;
    },getFile2(val) {
      this.fileListsb = val;

      return val;
    },getFile3(val) {
      this.fileListsc = val;

      return val;
    },getFile4(val) {
      this.fileListsd = val;

      return val;
    },
    getFile5(val) {
      this.fileListse = val;

      return val;
    },
    getFile6(val) {
      this.fileListsf = val;

      return val;
    },
    getFile7(val) {
      this.fileListsg = val;

      return val;
    },
    clickUpload() {
      this.dialogUpload = true;
    },
    clickUpload1() {
      this.dialogUpload1 = true;
    },
    clickUpload2() {
      this.dialogUpload2 = true;
    },clickUpload3() {
      this.dialogUpload3 = true;
    },clickUpload4() {
      this.dialogUpload4 = true;
    },
    clickUpload5() {
      this.dialogUpload5 = true;
    },
    clickUpload6() {
      this.dialogUpload6 = true;
    },
    clickUpload7() {
      this.dialogUpload7 = true;
    },
    clickDialog(index, prop) {
      this.$emit("clickDialog", index, prop);
    },

    clickUpload1() {
      this.dialogUpload1 = true;
    },
    openPdfs(v) {
      this.dialogVisibles = true;
      this.fileDetail = v;
    },
    openPdfs1(v) {
      this.dialogVisibles1 = true;
      this.fileDetail1 = v;
    },
    openPdfs2(v) {
      this.dialogVisibles2 = true;
      this.fileDetail2 = v;
    },
    openPdfs3(v) {
      this.dialogVisibles3 = true;
      this.fileDetail3 = v;
    },
    openPdfs4(v) {
      this.dialogVisibles4 = true;
      this.fileDetail4 = v;
    },
    openPdfs5(v) {
      this.dialogVisibles5 = true;
      this.fileDetail5 = v;
    },
    openPdfs6(v) {
      this.dialogVisibles6 = true;
      this.fileDetail6 = v;
    },
    openPdfs7(v) {
      this.dialogVisibles7 = true;
      this.fileDetail7 = v;
    },
    // 文件删除
    delteFile(file) {
      this.$emit("delteFile", file,0);
    },
    delteFile1(file) {
      this.$emit("delteFile", file,1);
    }, delteFile2(file) {
      this.$emit("delteFile", file,2);
    }, delteFile3(file) {
      this.$emit("delteFile", file,3);
    }, delteFile4(file) {
      this.$emit("delteFile", file,4);
    },
    delteFile5(file) {
      this.$emit("delteFile", file,5);
    },
    delteFile6(file) {
      this.$emit("delteFile", file,6);
    },
    delteFile7(file) {
      this.$emit("delteFile", file,7);
    },
    // 照片文件

    //select变化调用
    selectChange(value, index, prop) {
      this.$forceUpdate();
      this.$emit("selectChange", value, index, prop);
    },
    selectChange1(value, index, prop) {
      // console.log(value, index, prop);
      this.$forceUpdate();
      this.$emit("selectChange", value, index, prop);
    },

    // input的input事件
    inputINPUT(value, index, prop) {
      this.$emit("inputINPUT", value, index, prop);
    },
    // input的change事件
    inputChange(value, index, prop) {
      this.$emit("inputChange", value, index, prop);
    },
    inputFocus(index, prop) {
      this.$emit("inputFocus", index, prop);
    },
    inputBlur(value, index, prop) {
      this.$emit("inputBlur", value, index, prop);
    },
    // 搜索类型select搜索
    remoteMethod(query, index, prop) {
      if (query) {
        this.searchSelectLoading = true;
        this.$emit("querySelectValue", query, index, prop);
        setTimeout(() => {
          this.formObj[index].options = this.searchSelectOptionsCb;
          this.searchSelectLoading = false;
        }, 500);
      } else {
        this.searchSelectOptios = [];
      }
    },
    //switch变化
    formSwitchChange(val, index, prop) {
      this.$emit("formSwitchChange", val, index, prop);
    },
    //按钮点击事件
    buttonClick(prop, index) {
      this.$emit("buttonClick", prop, index);
    },
    changeRadio(val) {
      this.$emit("changeRadio", val);
    },



    //提交时验证表单，直接在父级调用
    submitForm() {
      let formValidate = Boolean;

      this.$refs.ruleForm.validate((valid) => {
        //  console.log(this.$refs.ruleForm);
        if(this.status=="有"){

       
        var a = 0;
  
        if (this.fileLists.length != 0) {
          a = 1;
        } else {
          this.uploadStyles = "1px solid red";
        }
        if (valid && a == 1) {
          formValidate = true;
          console.log(9999999);
        } else {
          console.log(22222222222);

          if (this.messAgeNum == 0) {
            this.$message.warning({
              content: "请把信息填写完整！",
              duration: 1000,
            });
          }

          formValidate = false;
        }
      }else if (this.status == "无") {
          if (valid) {
            formValidate = true;
          } else {
            if (this.messAgeNum == 0) {
              this.$message.warning({
                content: "请把信息填写完整！",
                duration: 1000,
              });
            }

            formValidate = false;
          }
        }
      });
      return formValidate;
    },
    /* 清空表单
              逻辑：
              1 、如果要清空文件上传列表，要传入要清空的upload的字段名，假如多个upload用for循环，调用清空方法！
              2、清空upload之后，还要把upload上传框展示出来，通过字段名比对，获取到在formObj中的下标，通过下标操作对象属性，进行展示
           */
    resetForm(uploadArr) {
      this.$refs.ruleForm.resetFields();
      if (uploadArr) {
        for (let i = 0; i < uploadArr.length; i++) {
          this.$refs[uploadArr[i]][0].clearFiles();
          let index = this.formObj.findIndex(
            (item) => item.prop == uploadArr[i]
          );
          this.formObj[index].uploadObj.hideUpload = false;
        }
      }
    },
    // 单个字段验证
    validateFieldProp(prop) {

      let formValidate = Boolean;
      this.$refs.ruleForm.validateField(prop, (valid) => {
        if (!valid) {
          formValidate = true;
        } else {
          formValidate = false;
        }
      });
      return formValidate;
    },
    // 对文件上传，删除进行赋值，调用form验证
    pushUpload(file, fileList, limit, prop) {
      if (fileList.length > 0) {
        this.formData[prop] = fileList;
      } else {
        // 表示没有数据,把字段置空
        this.formData[prop] = "";
      }
      this.$refs.ruleForm.validateField(prop); //调用验证form表单的文件上传
    },
    //地图input的input事件
    aMapInput(value, prop) {
      this.$refs[`aMap${prop}`][0].getSearch(value);
    },
    //子组件返回地图搜索值
    cbSearch(val, prop) {
      this.setSearchVal = val.tips; //子组件
      this.searchShow = prop; //显示input输入联想
    },
    //选中地图值
    selectVal(val, prop, index) {
      // 赋值的时候，拿到键，及formobj的下标，进行赋值
      this.formData[prop] = val.name; //input输入框赋值
      this.formData.district = val.district; //传入省市区
      let lngLat = {
        lng: val.location.lng,
        lat: val.location.lat,
      };
      this.formData[`${prop}location`] = lngLat;
      this.searchShow = ""; //隐藏input输入联想
      return index;
    },
  },
};
</script>

<style lang="less" scoped>
@width: 220px;

form {
  // overflow: hidden;
  display: flex;
  flex-wrap: wrap;
}

/deep/.el-input {
  width: @width;
}

/deep/.el-select {
  width: @width;
}

/deep/.el-date-editor.el-input {
  width: @width;
}

/deep/.el-date-editor .el-range-separator {
  width: 20px !important;
}

/deep/.el-range-editor--small.el-input__inner {
  width: 400px;
}

.el-textarea {
  width: 400px;
}

.hide {
  /deep/ .el-upload--picture-card {
    display: none;
  }
}

.amap_div {
  overflow: hidden;
  height: 400px;
  width: 600px;
  position: relative;

  .sreach_ul {
    position: absolute;
    top: 1;
    background-color: white;
    z-index: 9;
    min-width: 210px;
    float: auto;
    height: 200px;
    overflow: auto;
    padding: 0 20px;
    line-height: 24px;
  }
}

.mouldForm {
  height: 100%;
}

.upuupu {
  border: 1px solid red !important;
}
</style>
